<template>
  <div id="app">

    <ul>
      <li @click="goPage('/')">props/$emit | $bus</li>
      <li @click="goPage('/attrs')">$attrs/$listeners</li>
      <li @click="goPage('/inject')">provide/inject</li>
      <li @click="goPage('/ref')">$parent / $children与 ref</li>
    </ul>

    <router-view/>
  </div>
</template>
<script>
export default {
  methods: {
    goPage(url) {
      this.$router.push(url)
    }
  },
}
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}

ul{
  display: flex;
  margin: 0 auto;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 30px;
  justify-content: space-between;
  li{
    width: 200px;
    margin: 10px;
    height: 60px;
    flex-shrink: 0;
    cursor: pointer;
    list-style: none;
    line-height: 60px;
    text-align: center;
    background-color: #ccc;
    &:hover{
      color: blue;
      background-color: aliceblue;
    }
  }
}
</style>
